/*
 * @Author: 一盏青灯欲锁魂
 * @Date: 2021-06-15 16:23:16
 * @LastEditTime: 2021-06-25 09:39:23
 * @Description: 入口文件
 * @FilePath: \nest_demo\src\main.ts
 */
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { LoggerMiddleware } from './tools/middleware/logger.middleware';
import { HttpExceptionFilter } from './tools/filter/http_exception.filter';
import { CustomPipe } from './tools/pipe/custom.pipe';


async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // 全局使用中间件
  // app.use(LoggerMiddleware);

  // 全局过滤器
  app.useGlobalFilters(new HttpExceptionFilter());

  // 全局使用管道
  // app.useGlobalPipes(new CustomPipe());

  await app.listen(3030);
}
bootstrap();
